﻿using System.Web;

namespace WholesaleOnline.Controller.Storage
{
    public class HttpStorage : IHttpStorage
    {
        public void Add(HttpStorageKeys key, object value)
        {
            HttpContext.Current.Items.Add(key, value);
        }

        public bool TryGetValue(HttpStorageKeys key, out object value)
        {
            bool contains = HttpContext.Current.Items.Contains(key);
            value = contains ? HttpContext.Current.Items[key] : null;
            return contains;
        }
    }
}
